package hemowork06;

public class MethoDemo {
    public static void main(String[] args) {
       say();
       sayHi("GAGA");
       sayHello("LAOLIU",18);
        int a=getNum();
        System.out.println(a);
        double sum =plus(3.1,6.15);
        System.out.println(sum);
        int[] arr =testArray(10,88);
        System.out.println("数组的长度是"+arr.length);
        for (int i = 0; i < arr.length; i++) {
            System.out.println(arr[i]);
        }
        System.out.println("数组的第一位数是"+arr[0]+",数组的最后一位数是"+arr[arr.length-1]);


    }
    public static void say(){
        System.out.println("大家好");
    }

    public static void sayHi(String name){
        System.out.println("大家好我叫"+name);
    }

    public static void sayHello(String name ,int age){
        System.out.println("大家好我叫"+name+"，今年"+age+"岁了");
    }

    public static int getNum(){
        return 188;
    }

    public static double plus(double a,double b){
        double c=a+b;
        return c;
    }

    public static int[] testArray(int len,int max){
        int[] arr=new int[len];
        for (int i = 0; i < arr.length; i++) {
            arr[i]=(int)(Math.random()*(max+1));
        }
        return arr;
    }




}
